package subjectiveQuiz

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method("PUT")
        url(value(producer("/api/v3/subjectiveQuizzes/1")
                , consumer(regex("/api/v3/subjectiveQuizzes/\\d+"))))
        headers {
            contentType(applicationJsonUtf8())
            header("id", 1)
        }
        body("""
        {
            "description":"description",
            "remark":"remark",
            "tags":["java","jjj"],
            "quizGroupId":1
        }
        """)
        bodyMatchers {
            jsonPath('$.description', byRegex("[\\s\\S]+"))
            jsonPath('$.remark', byRegex("[\\s\\S]+"))
            jsonPath('$.tags', byRegex("[\\s\\S]+"))
        }
    }
    response {
        status(204)
    }
}
